|
accel34 2.2.0
|
API for configuring and manipulating Accel 34 Click driver. More...
Topics | |
| Accel 34 Registers List | |
| List of registers of Accel 34 Click driver. | |
| Accel 34 Registers Settings | |
| Settings for registers of Accel 34 Click driver. | |
| Accel 34 MikroBUS Map | |
| MikroBUS pin mapping of Accel 34 Click driver. | |
Functions | |
| void | accel34_cfg_setup (accel34_cfg_t *cfg) |
| Accel 34 configuration object setup function. | |
| err_t | accel34_init (accel34_t *ctx, accel34_cfg_t *cfg) |
| Accel 34 initialization function. | |
| err_t | accel34_default_cfg (accel34_t *ctx) |
| Accel 34 default configuration function. | |
| err_t | accel34_write_regs (accel34_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
| Accel 34 write multiple registers function. | |
| err_t | accel34_read_regs (accel34_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
| Accel 34 read multiple registers function. | |
| err_t | accel34_write_reg (accel34_t *ctx, uint8_t reg, uint8_t data_in) |
| Accel 34 write single register function. | |
| err_t | accel34_read_reg (accel34_t *ctx, uint8_t reg, uint8_t *data_out) |
| Accel 34 read single register function. | |
| uint8_t | accel34_get_int0_pin (accel34_t *ctx) |
| Accel 34 get INT0 pin state function. | |
| uint8_t | accel34_get_int1_pin (accel34_t *ctx) |
| Accel 34 get INT1 pin state function. | |
| err_t | accel34_check_communication (accel34_t *ctx) |
| Accel 34 check communication function. | |
| err_t | accel34_reset_device (accel34_t *ctx) |
| Accel 34 reset device function. | |
| err_t | accel34_set_op_mode (accel34_t *ctx, uint8_t op_mode) |
| Accel 34 set operating mode function. | |
| err_t | accel34_set_accel_fsr (accel34_t *ctx, uint8_t fsr) |
| Accel 34 set full-scale range function. | |
| err_t | accel34_get_drdy (accel34_t *ctx, uint8_t *drdy) |
| Accel 34 get data ready status function. | |
| err_t | accel34_get_accel (accel34_t *ctx, accel34_axes_t *accel) |
| Accel 34 get accelerometer data function. | |
| err_t | accel34_get_temp (accel34_t *ctx, float *temp) |
| Accel 34 get temperature function. | |
| err_t | accel34_get_data (accel34_t *ctx, accel34_data_t *data_out) |
| Accel 34 get accelerometer and temperature data function. | |
API for configuring and manipulating Accel 34 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void accel34_cfg_setup | ( | accel34_cfg_t * | cfg | ) |
Accel 34 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See accel34_cfg_t object definition for detailed explanation. |
| err_t accel34_check_communication | ( | accel34_t * | ctx | ) |
Accel 34 check communication function.
This function checks the communication by reading and verifying the device ID.
| [in] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
0 - Success (device detected), -1 - Error (device not detected). | err_t accel34_default_cfg | ( | accel34_t * | ctx | ) |
Accel 34 default configuration function.
This function executes a default configuration of Accel 34 Click board.
| [in] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t accel34_get_accel | ( | accel34_t * | ctx, |
| accel34_axes_t * | accel ) |
Accel 34 get accelerometer data function.
This function reads the accelerometer of X, Y, and Z axis relative to standard gravity (g).
| [in] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
| [out] | accel | : Pointer to store the acceleration values. |
0 - Success, -1 - Error (data not ready). | err_t accel34_get_data | ( | accel34_t * | ctx, |
| accel34_data_t * | data_out ) |
Accel 34 get accelerometer and temperature data function.
This function reads both accelerometer and temperature data from the device.
| [in] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
| [out] | data_out | : Pointer to store the acceleration and temperature values. |
0 - Success, -1 - Error (data not ready). | err_t accel34_get_drdy | ( | accel34_t * | ctx, |
| uint8_t * | drdy ) |
Accel 34 get data ready status function.
This function checks if new accelerometer data is available.
| [in] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
| [out] | drdy | :
|
0 - Success, -1 - Error. | uint8_t accel34_get_int0_pin | ( | accel34_t * | ctx | ) |
Accel 34 get INT0 pin state function.
This function returns the logic state of the INT0 interrupt pin.
| [in] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
| uint8_t accel34_get_int1_pin | ( | accel34_t * | ctx | ) |
Accel 34 get INT1 pin state function.
This function returns the logic state of the INT1 interrupt pin.
| [in] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
| err_t accel34_get_temp | ( | accel34_t * | ctx, |
| float * | temp ) |
Accel 34 get temperature function.
This function reads the internal temperature data from the device.
| [in] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
| [out] | temp | : Pointer to store the temperature value. |
0 - Success, -1 - Error (data not ready). | err_t accel34_init | ( | accel34_t * | ctx, |
| accel34_cfg_t * | cfg ) |
Accel 34 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See accel34_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t accel34_read_reg | ( | accel34_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out ) |
Accel 34 read single register function.
This function reads a single byte from a specified register of the Accel 34 device.
| [in] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [out] | data_out | : Pointer to store read data. |
0 - Success, -1 - Error. | err_t accel34_read_regs | ( | accel34_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out, | ||
| uint8_t | len ) |
Accel 34 read multiple registers function.
This function reads data from multiple registers of the Accel 34 device.
| [in] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
| [in] | reg | : Start register address. |
| [out] | data_out | : Data buffer to store read data. |
| [in] | len | : Number of bytes to read. |
0 - Success, -1 - Error. | err_t accel34_reset_device | ( | accel34_t * | ctx | ) |
Accel 34 reset device function.
This function soft resets the Accel 34 device.
| [in] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
0 - Success, -1 - Error. | err_t accel34_set_accel_fsr | ( | accel34_t * | ctx, |
| uint8_t | fsr ) |
Accel 34 set full-scale range function.
This function sets the accel measurement full scale range.
| [in] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
| [in] | fsr | :
|
0 - Success, -1 - Error. | err_t accel34_set_op_mode | ( | accel34_t * | ctx, |
| uint8_t | op_mode ) |
Accel 34 set operating mode function.
This function sets the operating mode of the Accel 34 device.
| [in] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
| [in] | op_mode | : Operating mode selection. |
0 - Success, -1 - Error. | err_t accel34_write_reg | ( | accel34_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t | data_in ) |
Accel 34 write single register function.
This function writes a single byte to a specified register of the Accel 34 device.
| [in] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
| [in] | reg | : Register address. |
| [in] | data_in | : Data to be written. |
0 - Success, -1 - Error. | err_t accel34_write_regs | ( | accel34_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_in, | ||
| uint8_t | len ) |
Accel 34 write multiple registers function.
This function writes data to multiple registers of the Accel 34 device.
| [in] | ctx | : Click context object. See accel34_t object definition for detailed explanation. |
| [in] | reg | : Start register address. |
| [in] | data_in | : Data buffer to be written. |
| [in] | len | : Number of bytes to write. |
0 - Success, -1 - Error.